﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CRMWeb.Utilities;

namespace CRMWeb.Pages
{
    public partial class Application_Form : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var time = DateTime.Now.ToUnix();
            var token = CryptographyHelper.EncryptStringHMACSHA256(time.ToString(), "PRIVATEKEY");
            bool isVerified= Request.QueryString["verified"] == "1";
          
            if (isVerified)
            {
                Response.Redirect(string.Format("~/form_view/Application_Form_print.php?id={0}&time={1}&token={2}", Request["id"], time, token));
            }
            else
            {
                Response.Redirect(string.Format("~/form_view/Application_Form.php?id={0}&time={1}&token={2}", Request["id"], time, token));
            }
           
        }
    }
}